package cn.ruituo.adv8.client;

import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Date;

public class GetObject {
    public static void main(String[] args)throws Exception {
        Socket s=new Socket("u3e6464044.zicp.vip",13769);
        InputStream in=s.getInputStream();
        OutputStream out=s.getOutputStream();
        ObjectOutputStream oout=new ObjectOutputStream(out);
        ObjectInputStream oin=new ObjectInputStream(in);

        Object o=oin.readObject();
        System.out.println(o);
        System.out.println("从"+s+"读到了 "+o);

        oout.writeObject(new Date());
        oout.flush();
        System.out.println("发送给"+s+"完毕！");
        s.close();
    }
}
